﻿using System;
using System.Linq;
using System.Runtime.CompilerServices;
using UnityEngine;
using UnityEngine.Events;
using UnityEngine.UI;

[RequireComponent(typeof(Dropdown))]
public class UIQualityDropdown : MonoBehaviour
{
    [CompilerGenerated]
    private static UnityAction<int> <>f__am$cache1;
    private Dropdown dropdown;
    private const string key = "UnityGraphicsQuality";

    private void Awake()
    {
        this.dropdown = base.GetComponent<Dropdown>();
        this.dropdown.AddOptions(QualitySettings.names.ToList<string>());
        if (PlayerPrefs.HasKey("UnityGraphicsQuality"))
        {
            this.dropdown.value = PlayerPrefs.GetInt("UnityGraphicsQuality");
        }
        if (<>f__am$cache1 == null)
        {
            <>f__am$cache1 = delegate (int v) {
                QualitySettings.SetQualityLevel(v, true);
                PlayerPrefs.SetInt("UnityGraphicsQuality", v);
            };
        }
        this.dropdown.onValueChanged.AddListener(<>f__am$cache1);
    }
}

